import { defHttp } from "@/utils/http";
export const todoApi = {
	//获取 Todo 待办任务分页
	taskTodoPage: async (params: any) => {
		return await defHttp.get({ url: "/bpm/task/todo-page", params });
	},

	//审批详情详细信息
	processInstance: async (id: string) => {
		return defHttp.get({ url: `bpm/process-instance/get-bpmn-model-view?id=${id}` });
	},
	//获取审批人员
	simpleList: async () => {
		return await defHttp.get({ url: "/system/user/simple-list" });
	},
	//获取流转记录
	taskListByProcessInstanceId: async (id: string) => {
		return await defHttp.get({ url: `/bpm/task/list-by-process-instance-id?processInstanceId=${id}` });
	},
	//审批通过
	taskApprove: async (params: any) => {
		return await defHttp.put({ url: "/bpm/task/approve", params });
	},
	//审批不通过
	taskReject: async (params: any) => {
		return await defHttp.put({ url: "/bpm/task/reject", params });
	},
	//抄送
	taskCopy: async (params: any) => {
		return await defHttp.put({ url: "/bpm/task/copy", params });
	},
	//转办
	taskTransfer: async (params: any) => {
		return await defHttp.put({ url: "/bpm/task/transfer", params });
	},
	//委派
	taskDelegate: async (params: any) => {
		return await defHttp.put({ url: "/bpm/task/delegate", params });
	},
	//加签
	taskCreateSign: async (params: any) => {
		return await defHttp.put({ url: "/bpm/task/create-sign", params });
	},
	//退回
	taskListByReturn: async (id: any) => {
		return await defHttp.get({ url: `/bpm/task/list-by-return?id=${id}` });
	},
	//取消
	processInstanceCancelByStartUser: async (params: any) => {
		return await defHttp.delete({ url: "/bpm/process-instance/cancel-by-start-user", params });
	}
};
